package com.ssy.jt808.gateway.sdk.terminal.constant.location.addition;

import java.util.Map;
import java.util.TreeMap;

/**
 * @author zeno
 */
public enum RouteDriveTimeResultEnum{

  /** 行使时间不足 */
  LackTime(0),
  /** 行驶路径超时 */
  OverTime(1);

  RouteDriveTimeResultEnum( int id ){
    this.id = id;
  }

  private int id;

  private static final Map<Integer,RouteDriveTimeResultEnum> ID_MAP;

  static{
    ID_MAP = new TreeMap<>();
    RouteDriveTimeResultEnum[] values = RouteDriveTimeResultEnum.values();
    for(RouteDriveTimeResultEnum value : values){
      ID_MAP.put(value.id, value);
    }
  }

  public static RouteDriveTimeResultEnum map( int id ){
    RouteDriveTimeResultEnum locationAdditionInfoEnum = ID_MAP.get(id);
    assert locationAdditionInfoEnum != null;
    return locationAdditionInfoEnum;
  }
}
